import store from '@/store'

//判断用户是否拥有操作权限
export function hasMenuPermission (perms) {
  if (process.env.NODE_ENV == "development") {
    return true;
  } else {
    let hasPermission = false;
    let permissions = store.state.menu.navTree;
    for (let i = 0; i < permissions.length; i++) {
      if (permissions[i].menuCode === perms) {
        hasPermission = true;
        break;
      }
    }
    return hasPermission;
  }
}